package com.battle.service.controller.web;

import com.battle.pojo.param.applicationFeedback.*;
import com.battle.pojo.vo.applicationFeedback.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
 * web/应用反馈
 * 【描 述】：
 * 【环 境】：J2SE
 * 【详 细】：
 */
@RestController
@RequestMapping("/applicationFeedback/web")
public class ApplicationFeedbackWebController {

    private final ApplicationFeedbackService service;

    public ApplicationFeedbackWebController(ApplicationFeedbackService service) {
        this.service = service;
    }


    /**
     * 创建应用反馈
     *
     * @param param
     * @return
     */
    @PostMapping("/createApplicationFeedback")
    public ApiResult createApplicationFeedback(@RequestBody @Valid CreateApplicationFeedbackParam param) {
        service.createApplicationFeedback(param);
        return ApiResult.ok();
    }


    /**
     * 获取应用反馈列表
     *
     * @return
     */
    @PostMapping("/getApplicationFeedbackDownList")
    public ApiResult<List<GetApplicationFeedbackDownListVo>> getApplicationFeedbackDownList(@RequestBody(required = false) @Valid GetApplicationFeedbackDownListParam param) {
        List<GetApplicationFeedbackDownListVo> list = service.getApplicationFeedbackDownList(param);
        return ApiResult.ok(list);
    }


}

